<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

/*Route::get('/', 'WelcomeController@index');

Route::get('home', 'HomeController@index');

*/

Route::get('/', 'IndexController@index');

/*用户信息*/
Route::get('/userinfo',
        ['middleware' => 'auth', 'uses' => 'UserController@userinfo']);

Route::post('/userinfo',
    ['middleware' => 'auth', 'uses' => 'UserController@edituserinfo']);

Route::post('/uploadhead',
    ['middleware' => 'auth', 'uses' => 'UserController@uploadhead']);

/*登陆注册*/
Route::controllers([
    'auth' => 'Auth\AuthController',
    'password' => 'Auth\PasswordController',
]);

/*查看帖子图片*/
Route::get('/image/{tid}',
        ['middleware' => 'auth', 'uses' => 'IndexController@image'])
        ->where('tid', '[0-9]+');

/*收藏*/
Route::get('/tocollect/{id}/{tid}',
        ['middleware' => 'auth', 'uses' => 'UserController@tocollect'])
        ->where('tid', '[0-9]+');

Route::get('/collect',
    ['middleware' => 'auth', 'uses' => 'UserController@collect'])
    ->where('num', '[0-9]+');

/*广场*/
Route::get('/square', 'IndexController@square');